package com.my.softkeyboard;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;

public class softkeyboardActivity extends Activity {
    /** Called when the activity is first created. */
	private Button showButton;
	private Button hideButton;
	private EditText editText;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        showButton = (Button)findViewById(R.id.Button01);
        hideButton = (Button)findViewById(R.id.Button02);
        editText = (EditText)findViewById(R.id.EditText01);
        
        editText.setInputType(0);
        
        showButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
				imm.showSoftInput(editText, 0);
			}
		});
        
        hideButton.setOnClickListener(new OnClickListener() {
        	
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
				imm.hideSoftInputFromWindow(hideButton.getWindowToken(), 0); 
			}
		});
        
        
        
    }
}